import React, { Component } from "react";
import { View, Text, Image, StyleSheet, FlatList } from "react-native";
import CustomerHeader from "../../widget/customerHeader";

export default class MyLearnRecord extends Component{
  constructor(props) {
    super(props);
    this.state={
      dataList:[{
        label:'1',
        value:1
      },{
        label:'2',
        value:2
      }]
    }
  }
  _renderKnowledgeCell=({data})=>{
    return (
      <View style={styles.cell}>
        <Image style={styles.knowledgeIcon} source={require('../../img/classroom.png')}></Image>
        <View style={{marginLeft:11,flex:1}}>
          <Text style={{color:'#0F0F0F',fontSize:15}}><Text style={{color:'#E39354'}}>人力资源</Text>管理六大模块知识
            讲解</Text>
          <Text style={{color:'#959595',fontSize:11,marginTop:16}}>学习至20%</Text>
        </View>
      </View>
    )
  }
  render() {
    return(
      <View style={{flex:1,backgroundColor:'#fff'}}>
        <CustomerHeader title={'学习记录'} leftOnPress={()=>{this.props.navigation.pop()}}></CustomerHeader>
        <View style={{flex:1,backgroundColor:'#F6F6F6'}}>
          <FlatList data={this.state.dataList} renderItem={this._renderKnowledgeCell}></FlatList>
        </View>
      </View>
    )
  }
}

const styles=StyleSheet.create({
  /**cell*/
  cell:{
    padding:15,
    backgroundColor:'#fff',
    flexDirection:'row',
    justifyContent:'flex-start'
  },
  knowledgeIcon:{
    width:115,
    height:65
  },
  info:{
    flex:1
  },
  infoIcon:{
    width:97,
    height:65,
    borderRadius: 7
  },
})
